<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class timeline_model extends CI_Model {

	public function get_timeline()
	{
		$this->db->select('event_name ,event_start');
		$this->db->where('vdo_status',0);
		$this->db->where_not_in('event_start' ,'');
		$query = $this->db->get('vdo');
		return $query->result_array();
	}	

	public function get_year()
	{
		$this->db->select('YEAR(event_start)');
		$this->db->where('vdo_status',0);
		$this->db->where_not_in('event_start' ,'');
		$this->db->group_by('YEAR(event_start)');
		$query = $this->db->get('vdo');
		return $query->result_array();
	}	

	public function get_event($input)
	{		
		$this->db->where('event_name',$input['event_name']);
		$this->db->where('vdo_status',0);
		$this->db->where('MONTH(event_start)',$input['month']);
		$this->db->where('YEAR(event_start)',$input['year']);
		$this->db->where('vdo_thumb.thumb_choose',1);
		$this->db->join('vdo_thumb','vdo_thumb.vdo_id = vdo.vdo_id','left');
		$query = $this->db->get('vdo');
		return $query->result_array();
	}

		



}